package com.sc.controller;

import com.github.pagehelper.PageInfo;
import com.sc.pojo.Huser;
import com.sc.service.HuserService;
import com.sc.service.impl.HuserServiceImpl;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Map;

@Controller
public class HuserController {
    HuserService us = new HuserServiceImpl();
    @RequestMapping("/show")
    public String Tshow(@RequestParam(defaultValue = "1") Integer pageNum,
                       @RequestParam(defaultValue = "3") Integer pageSize,
                       Map m) {
        PageInfo<Huser> p = us.show(pageNum,pageSize);
        for (Huser huser : p.getList()) {
            System.out.println(huser.getAccount());
        }
        m.put("p",p);
        return "/user/list";
    }

    @RequestMapping("/tolist")
    public String Ttolist() {
        return "/user/list";
    }
}
